'use strict';
(function() {
	'use strict';

	var sche = {
			'/': 'index',
			'/index': 'index',

			'/order/ordering.action': 'order',

			'/product/listProduct.action': 'product',
			'/product/manageProduct.action': 'product',
			'/productType/listProductType.action': 'product',
			'/productType/listProducts.action': 'product',

			'/order/listOrder.action': 'listOrder',
			'/order/listOrderItems.action': 'listOrder',
			'/order/listReturns.action': 'listOrder',
			'/order/listOrderItems.action': 'listOrder',

			'/chart/saleAmount.action': 'chart',
			'/chart/saleStatistic.action': 'chart',

			'/user/listUser.action': 'user',
			'/user/manageUser.action': 'user'
		},
		action = window.location.pathname,
		target = null;

	action = action.replace('/Pos43', '');
	target = sche[action];

	// 褰撳墠椤甸潰鐨�sidebar 楂樹寒
	if(target) {
		$('.sidebar-menu').children('li').each(function() {
			if($(this).attr('data-tag') === target) {
				$(this).addClass('active');
			}
		});
	}

})();